package org.apache.struts.admin.action;

import org.apache.struts.admin.model.AddUserClassForm;
import org.apache.struts.admin.model.AddUserClassForm;
import org.apache.struts.ehr.medical_records.model.ReplyMessage;

import com.opensymphony.xwork2.ActionSupport;

public class AddUserClassFormAction extends ActionSupport{

	private AddUserClassForm addUserClass;
	private ReplyMessage replyMessage;
	
	public ReplyMessage getReplyMessage() {
		return replyMessage;
	}

	public AddUserClassForm getAddUserClass() {
		return addUserClass;
	}

	public void setAddUserClass(AddUserClassForm addUserClass) {
		this.addUserClass = addUserClass;
	}

	public String execute() throws Exception {
		replyMessage=new ReplyMessage();
		replyMessage.setMessage("empty");
		if(addUserClass!=null && addUserClass.getUserClass()!=null){
			String x="User Class :"+addUserClass.getUserClass()+" , User roles : ";
			for(int i=0; i<addUserClass.getRoles().size(); i++){
				x=x+addUserClass.getRoles().get(i)+" , ";
			}
			replyMessage.setMessage(x);
		}
		return SUCCESS;
	}
}
